Is `xargs -t` output stderr or stdout, and can you control it?

Posted by Roy Rico on Stack Overflow See other posts from Stack Overflow or by Roy Rico
Published on 2009-05-09T00:44:51Z Indexed on 2010/06/10 19:42 UTC
Read the original article Hit count: 200

Filed under:
|

say i have a directory with hi.txt and blah.txt and i execute the following command on a linux-ish command line

ls *.* | xargs -t -i{} echo {}

the output you will see is

echo blah.txt
blah.txt
echo hi.txt
hi.txt

i'd like to redirect the stderr output (say 'echo blah.txt' fails...), leaving only the output from the xargs -t command written to std out, but it looks as if it's stderr as well.

ls *.* | xargs -t -i{} echo {} 2> /dev/null

Is there a way to control it, to make it output to stdout?

© Stack Overflow or respective owner

Related posts about command-line

Related posts about xargs